package com.viettel.pon.logs;

import java.io.File;
import java.io.IOException;

import android.app.Application;
import android.os.Environment;
import android.util.Log;

public class Log4jApplication extends Application {
 
    @Override
    public void onCreate() {
        super.onCreate();
 
        // configure log4j
        System.out.println("---------------------------------hungkq 0--------------");
        configureLog4j();
        System.out.println("---------------------------------hungkq 1--------------");
    }
 
    private void configureLog4j() {
    	
        String fileName = Environment.getExternalStorageDirectory() + "/" + "log4j.log";
        String filePattern = "%d - [%c] - %p : %m%n";
        int maxBackupSize = 10;
        long maxFileSize = 1024 * 1024;
 
        Log4jHelper.Configure(fileName, filePattern, maxBackupSize, maxFileSize);
    }

}
